﻿<!--#include file="../lib/base.asp"-->
<%

	dim filetype:filetype=Cls.getint(Cls.fget("filetype",0),1)
	dim limit:limit=Cls.getint(Cls.fget("limit",0),1)
	if limit>10 then limit=1
	dim uptype,cid,classid
	cid=Cls.getint(Cls.fget("cid",0),0)
	classid=Cls.getint(Cls.fget("classid",0),0)
	select case filetype
		case "2":uptype="|doc|docx|xls|xlsx|ppt|pptx|rar|zip|7z|pdf|txt"
		case "3":uptype="|flv|mp4|rm|rmvb|wmv|3gp|avi|mpeg|swf"
		case "4":uptype="|gif|jpg|png|doc|docx|xls|xlsx|ppt|pptx|rar|zip|7z|pdf|txt|flv"
		case "5":uptype="|swf"
		case else:uptype="|gif|jpg|png"
	end select
	uptype=replace(uptype,"|",";*.")
	uptype=right(uptype,len(uptype)-1)
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../Css/base.css" rel="stylesheet" type="text/css" />
<link href="../css/public.css" rel="stylesheet" type="text/css" />
<link href="../css/iframe.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/jquery.js"></script>
<script language="javascript" src="../js/jquery.artDialog.js?skin=default"></script>
<script language="javascript" src="../js/artDialog.iframeTools.js"></script>
<script language="javascript" src="../js/base.js"></script>
<script language="javascript" src="../js/admin.js"></script>
<link href="../css/swfupload.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/swfupload.js"></script>
<script type="text/javascript" src="../js/fileprogress.js"></script>
<script type="text/javascript" src="../js/handlers.js"></script>
<script>
var swfupload;
$(function(){
swfupload=new SWFUpload({
	flash_url:"swf/swfupload.swf?"+Math.random(),
	upload_url:"upload_swf.asp?act=swf&filetype=<%=filetype%>&admin_id=<%Cls.loadsession("adminid")%>&loginbase=<%Cls.loadsession("loginpwd")%>&loginkey=<%Cls.loadsession("loginkey")%>",
	file_size_limit:"2048 KB",
	file_types:"<%=uptype%>",
	file_types_description:"All Files",
	file_upload_limit:"<%=limit%>",
	custom_settings:{progressTarget:"fsUploadProgress",cancelButtonId:"btnCancel"},
	button_image_url:"images/upload.gif",
	button_width:74,
	button_height:28,
	button_placeholder_id:"imagelist",
	button_window_mode:SWFUpload.WINDOW_MODE.TRANSPARENT,
	button_cursor:SWFUpload.CURSOR.HAND,
	file_dialog_start_handler:fileDialogStart,
	file_queued_handler:fileQueued,
	file_queue_error_handler:fileQueueError,
	file_dialog_complete_handler:fileDialogComplete,
	upload_progress_handler:uploadProgress,
	upload_error_handler:uploadError,
	upload_success_handler:uploadSuccess,
	upload_complete_handler:uploadComplete
	});
	
})
</script>
</head>

<body>
<ul class="upload">
    <li id="imagelist"></li>
</ul>
<div id="start"><img src="../images/start.gif" width="74" height="28" onClick="swfupload.startUpload();" /></div>
<div id="count">本次共允许上传<span><%=limit%></span>个文件，每个文件不超过<span>2</span>Mb</div>
<div id="types">允许的格式：<%=uptype%></div>
<fieldset class="blue" >
<legend>文件列表</legend>
<ul class="attachment-list" id="fsUploadProgress">    
</ul>
</fieldset>

<div id="att-status" class="hidden"></div>
<div id="att-status-del" class="hidden"></div>
<div id="att-name" class="hidden"></div>
<script type="text/javascript">  
function album_cancel(obj,id,source){
	var src = $(obj).children("img").attr("path");
	var filename = $(obj).attr('title');
	if($(obj).hasClass('on')){
		$(obj).removeClass("on");
		var imgstr = $("#att-status").html();
		var length = $("a[class='on']").children("img").length;
		var strs = filenames = '';
		for(var i=0;i<length;i++){
			strs += '|'+$("a[class='on']").children("img").eq(i).attr('path');
			filenames += '|'+$("a[class='on']").children("img").eq(i).attr('title');
		}
		$('#att-status').html(strs);
		$('#att-status').html(filenames);
	} else {
		var num = $('#att-status').html().split('|').length;
		$(obj).addClass("on");
		$('#att-status').append('|'+src);
		$('#att-name').append('|'+filename);
	}
}
</script>
</body>
</html>
